package main

import (
	"flag"
	"fmt"
	"os"
	"time"
)

func main() {
	RecTemperature := false
	Looping := false
	Delay := 1000
	flag.BoolVar(&RecTemperature, "r", false, "接收温度")
	flag.BoolVar(&Looping, "l", false, "是否需要一直运行,如果没有指定所有命令都将只执行一次")
	flag.IntVar(&Delay, "d", 1000, "刷新时间")
	flag.Parse()
	if len(os.Args) == 1 {
		fmt.Println("请输入指令,    -h可以获取帮助")
		os.Exit(0)
	}
	for {

		fmt.Print("456")

		if Looping {
			break
		}
		time.Sleep(time.Millisecond * time.Duration(Delay))
	}
}
